<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition >

            <p:commandButton value="Use Default Credit Term" action="#{creditTermEntityController.useDefaultTerm()}" ajax="false"/>
<!--            <h:outputText value="  " />-->
            <p:commandButton value="New Credit Term" action="#{creditTermEntityController.prepareCreate()}" onsuccess="carDialog.show();"/>

            <p:dialog header="New Credit Term" widgetVar="carDialog" resizable="false"  
                      width="400" showEffect="explode" hideEffect="explode">  

                <h:panelGrid id="display" columns="2" >

                    <h:outputLabel value="#{bundle.CreateCreditTermEntityLabel_creditLimit}" for="creditLimit" />
                    <h:inputText id="creditLimit" value="#{creditTermEntityController.selected.creditLimit}" title="#{bundle.CreateCreditTermEntityTitle_creditLimit}" />

                    <h:outputLabel value="#{bundle.CreateCreditTermEntityLabel_discount}" for="discount" />
                    <h:inputText id="discount" value="#{creditTermEntityController.selected.discount}" title="#{bundle.CreateCreditTermEntityTitle_discount}" />

                    <h:outputLabel value="#{bundle.CreateCreditTermEntityLabel_discountRepayTime}" for="discountRepayTime" />
                    <h:inputText id="discountRepayTime" value="#{creditTermEntityController.selected.discountRepayTime}" title="#{bundle.CreateCreditTermEntityTitle_discountRepayTime}" />

                    <h:outputLabel value="#{bundle.CreateCreditTermEntityLabel_lateCharges}" for="lateCharges" />
                    <h:inputText id="lateCharges" value="#{creditTermEntityController.selected.lateCharges}" title="#{bundle.CreateCreditTermEntityTitle_lateCharges}" />

                    <h:outputLabel value="#{bundle.CreateCreditTermEntityLabel_maxRepayTime}" for="maxRepayTime" />
                    <h:inputText id="maxRepayTime" value="#{creditTermEntityController.selected.maxRepayTime}" title="#{bundle.CreateCreditTermEntityTitle_maxRepayTime}" />

                    <h:outputText value=" " />
                    <p:commandButton action="#{creditTermEntityController.createAndAssign()}" value="Save" oncomplete="carDialog.hide();" ajax="false"/>
                </h:panelGrid>

            </p:dialog> 
    </ui:composition>

</html>
